<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <title>登录</title>
    <meta name="keywords" content="学生考勤系统">

    <link rel="shortcut icon" href="favicon.ico"/>
    <link rel="bookmark" href="favicon.ico"/>
    <link th:href="@{/h-ui/css/H-ui.min.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{/h-ui/css/H-ui.login.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{/h-ui/lib/icheck/icheck.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{/h-ui/lib/Hui-iconfont/1.0.1/iconfont.css}" rel="stylesheet" type="text/css"/>

    <link rel="stylesheet" type="text/css" th:href="@{/easyui/themes/default/easyui.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/easyui/themes/icon.css}">

    <script type="text/javascript" th:src="@{/easyui/jquery.min.js}"></script>
    <script type="text/javascript" th:src="@{/h-ui/js/H-ui.js}"></script>
    <script type="text/javascript" th:src="@{/h-ui/lib/icheck/jquery.icheck.min.js}"></script>
    <script type="text/javascript" th:src="@{/easyui/jquery.easyui.min.js}"></script>
    <script type="text/javascript" th:inline="javascript">
        $(function () {
            // 登录  采用异步ajax完成
            $("#submitBtn").click(function () {
                $.ajax({
                    type: "post",  //请求的方式
                    url: "/user/login", //请求的路径
                    data: $("#form").serialize(), //serialize() 可以自动将我们的参数封装成我们想要的格式拼接在url后面
                    dataType: "json", //返回数据类型
                    success: function (data) {  //data封装的是返回的数据
                        console.log("data:", data);
                        if (data.success) {
                            //成功之后跳转到首页
                            window.location.href = "/user/index";
                        } else {
                            $.messager.alert("提示信息", data.message, "warning");
                        }
                    }
                });
            });
        })
    </script>
</head>
<body>

<div class="header" style="padding: 0;">
	<span style="color: white; width: 400px; height: 600px; line-height: 60px; padding: 0;font-family: '华文行楷';font-weight: bold;font-size: 65px;">武汉生物工程学院</span>
    <span style="color: white; width: 400px; height: 600px; line-height: 60px; margin: 0 0 0 30px; padding: 0;font-family: '楷体';font-weight: bold;font-size: 45px;">数计学院学生考勤管理系统</span>
</div>
<div class="loginWraper">
    <div id="loginform" class="loginBox">
        <div class="div-logo">
            <img th:src="@{/h-ui/images/logo.jpg}" style="width:100px">
            <span class="div-font">学生考勤管理系统</span>
        </div>
        <form id="form" class="form form-horizontal" method="post">
            <div class="row cl">
                <label class="form-label col-3"><i class="Hui-iconfont">用户名：</i></label>
                <div class="formControls col-8">
                    <input id="username" name="username" type="text" placeholder="请输入用户名或学号"
                           class="input-text size-L">
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-3"><i class="Hui-iconfont">密&nbsp;&nbsp;&nbsp;码：</i></label>
                <div class="formControls col-8">
                    <input id="password" name="password" type="password" placeholder="请输入密码"
                           class="input-text size-L">
                </div>
            </div>

            <div class="row">
                <div class="formControls col-8 col-offset-3">
                    <input id="submitBtn" type="button" class="btn btn-success radius size-L"
                           value="&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;">
                    <input id="resetBtn" type="reset" class="btn btn-danger radius size-L" style="float: right;margin-right: 40px;"
                           value="&nbsp;重&nbsp;&nbsp;&nbsp;&nbsp;置&nbsp;">
                </div>
            </div>
        </form>
    </div>
</div>
<div class="footer">
    <span>Copyriht &copy; 2021-2022 XXX学院&nbsp;&nbsp;&nbsp;&nbsp; 版权归属：Web应用开发专业团队</span>
</div>
</body>
</html>